package com.sansecy.designpatternlearn.factory;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.sansecy.designpatternlearn.R;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView textView = findViewById(R.id.textView);
        BreadFactory breadFactory = new BreadFactory();
        Bread bag = breadFactory.getBread("BAG");
        textView.setText(bag.name());
    }
}